﻿$(function() {

         // $.ajax({
             // type: "get",
             // url: "http://192.168.8.123:8080/jeecg/wecharReportController.do?queryTransitData1",
             // dataType: "json",
             // async: true,
             // success: function(data) {
                 // console.info(data);
    var data = $.parseJSON('{"message":"true","SUCCESS":"true","queryData":[{"II":"885982","ID":"1502328","YEAR":"2014","DD":"739122","DI":"1457632"},{"II":"980912","ID":"1974346","YEAR":"2015","DD":"914700","DI":"1983950"},{"II":"1499946","ID":"2286696","YEAR":"2016","DD":"840516","DI":"2279648"}]}');
    init(data);
    function init(data){
        if(data.SUCCESS) {
        $('#chart3').highcharts({
            chart: {
                zoomType: 'none'
            },
            title: {
                text: '中转数'
            },
            credits: {
                enabled: false
            },
            xAxis: [{
                categories: arrayListKeyWord(data.queryData, "YEAR", false),
                crosshair: true
            }],
            yAxis: [{ // Primary yAxis
                labels: {
                    format: '{value}万人次',
                    style: {
                        color: Highcharts.getOptions().colors[1]
                    }
                },
                title: {
                    text: '人次',
                    style: {
                        color: Highcharts.getOptions().colors[1]
                    }
                }
            },{ // Primary yAxis
                labels: {
                    format: '{value}万人次',
                    style: {
                        color: Highcharts.getOptions().colors[1]
                    }
                },
                title: {
                    text: '人次',
                    style: {
                        color: Highcharts.getOptions().colors[1]
                    }
                },
            visible: false
            }],
            tooltip: {
                shared: true
            },
            series: [{
                name: '国内~国内中转数',
                type: 'column',
                yAxis: 1,
                data: arrayListKeyWord2(data.queryData, "II", false),
                tooltip: {
                    valueSuffix: '万人次'
                }
            }, {
                name: '国内~国际中转数',
                type: 'column',
                yAxis: 1,
                data: arrayListKeyWord2(data.queryData, "ID", false),
                tooltip: {
                    valueSuffix: '万人次'
                }
            }, {
                name: '国际~国际中转数',
                type: 'column',
                yAxis: 1,
                data: arrayListKeyWord2(data.queryData, "DD", false),
                tooltip: {
                    valueSuffix: '万人次'
                }
            }, {
                name: '国际~国内中转数',
                type: 'column',
                yAxis: 1,
                data: arrayListKeyWord2(data.queryData, "DI", false),
                tooltip: {
                    valueSuffix: '万人次'
                }
            }, {
                name: '国内~国内中转数',
                type: 'spline',
                data: arrayPercentage(data.queryData, "II", false),
                tooltip: {
                    valueSuffix: '万人次'
                }
            }, {
                name: '国内~国际中转数',
                type: 'spline',
                data: arrayPercentage(data.queryData, "ID", false),
                tooltip: {
                    valueSuffix: '万人次'
                }
            }, {
                name: '国际~国际中转数',
                type: 'spline',
                data: arrayPercentage(data.queryData, "DD", false),
                tooltip: {
                    valueSuffix: '万人次'
                }
            }, {
                name: '国际~国内中转数',
                type: 'spline',
                data: arrayPercentage(data.queryData, "DI", false),
                tooltip: {
                    valueSuffix: '万人次'
                }
            }]
        });
        
        
        
        var tableTpl3 = document.getElementById('tableTpl3').innerHTML;
        laytpl(tableTpl3).render(data.queryData, function(html){
          document.getElementById('table3').innerHTML = html;
        });
        
}
    }
             // }
         // });

});